package com.java.huxb.day06;

import com.java.huxb.day06.entity.Student;
import com.java.huxb.day06.entity.Teacher;
import com.java.huxb.day06.utils.FormatUserName;
import com.java.huxb.day06.utils.Utils;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * @author huxb
 * @date 2020/4/4 0004 下午 2:42
 */
public class Index {
    public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
        List<Student> studentList = Utils.getStudentList();
        FormatUserName.formatUserName(studentList, "getId", "setStudentName");

        List<Teacher> teacherList = Utils.getTeacherList();
        FormatUserName.formatUserName(teacherList, "getId", "setName");

        for (Student student : studentList) {
            System.out.println(student);
        }
        for (Teacher teacher : teacherList) {
            System.out.println(teacher);
        }
    }
}
